package study.week05.main;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import study.week05.entity.Klass;
import study.week05.entity.School;
import study.week05.entity.Student;

public class SpringBeanTest {

    public static void main(String[] args) {
        // 读xml
        useXml();

    }

    static void useXml(){
        System.out.println("========================================");
        System.out.println("自定义配置xml:");
        ApplicationContext context = new ClassPathXmlApplicationContext("beanConfig.xml");
        School school= context.getBean(School.class);
        Student student = context.getBean(Student.class);
        Klass klass = context.getBean(Klass.class);
        System.out.println(school);
        System.out.println(student);
        System.out.println(klass);
    }



}
